package com.example.todolist.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.io.Serializable;




/**
 * <p>
 *
 * </p>
 *
 * @author mybatis-generator
 * @since 2021-08-25
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@NoArgsConstructor
@TableName("todo_item")
public class TodoItemModel implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private int id;

    private String content;

    private Boolean done;


    public TodoItemModel(final String content) {
        this.content = content;
        this.done = false;
    }


    public TodoItemModel(Integer id, final String content) {
        this.id = id;
        this.content = content;
        this.done = false;
    }

    public void markDone() {
        this.done = true;
    }

}
